import { request } from '@/utils/request';

const url = '/api/console/patch';
export default {
  list: (params: any) => request.get({ url: `${url}`, params }),
  add: (data: any) => request.post({ url, data }),
  update: (data: any) => request.patch({ url, data }),
  del: (id: number) => request.delete({ url: `${url}/${id}` }),
  delbat: (ids: number[]) => request.patch({ url: `${url}/delete`, data: { ids } }),
  detail: (id: number) => request.get({ url: `${url}/${id}` }),
  display: (id: number, val: number) => request.patch({ url: `${url}/display/${id}/${val}` }),
  displayBat: (data: any) => request.patch({ url: `${url}/displayBat`, data }),
  displayDel: (data: any) => request.patch({ url: `${url}/displayDel`, data }),

  updateText: (data: any) => request.patch({ url: `${url}/text`, data }),
  patchList: (params: any) => request.get({ url: `${url}/list`, params }),
  patchListAdd: (data: any) => request.post({ url: `${url}/list`, data }),
  patchListUpdate: (data: any) => request.patch({ url: `${url}/list`, data }),
  patchListDel: (id: number) => request.delete({ url: `${url}/list/${id}` }),
  patchListSort: (data: any) => request.patch({ url: `${url}/list/${data.id}/${data.listorder}` }),
};
